<?php
class  chunk_base{
	
	function loadPlantilla($plantilla){
		if(file_exists($this->selfpath.$plantilla)){
			return file_get_contents($this->selfpath.$plantilla);
		}
	}
	function parce($pantilla, $valores){
		foreach(array_keys($valores) as $k){
			$pantilla=str_replace("#$k#",$valores[$k],$pantilla);
		}
		$plantilla=preg_replace('/#[a-z0-9]/i', "", $plantilla);
		return $pantilla;
	}
	function loadScripts(&$document){
		foreach($this->scripts as $s){
			$document->addScript($s);
		}
	}
	function loadStyles(&$document){
		foreach($this->styles as $s){
			$document->addStyle($s);
		}
	}
}
